package tom.server;

import javax.servlet.ServletContext;
import javax.servlet.http.*;

public class CleanSessionListener implements HttpSessionListener {

	@Override
	public void sessionCreated(HttpSessionEvent e) {
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent e) {
		ServletContext context = e.getSession().getServletContext();
		String sessionid = e.getSession().getId();
		context.log("Destroy Session " + sessionid);
		context.removeAttribute(sessionid);
	}
}
